<!--
$(function(){

	$("#dele-no").live('click',function(){
		$(this).parents('#dele-tips').remove();
	});
	$('#dele-yes').live('click',function(){
		var url = $(this).attr('url');
		var id = $(this).attr('trid');
		$.post(url,{},function(data){
			if(data == 'file_noexist'){
				alert('删除文件不存在');
			}else if(data == 'dele_statice_success'){
				alert('删除静态化文件成功');
				$("#"+id).find('a.sta').html('静态化');
			}else if(data == 'dele_statice_fail'){
				alert('删除静态化文件失败');
			}else if(data == 'delete_success'){
				alert('删除成功');
				$("#"+id).remove();
			}else if(data == 'delete_fail'){
				alert('删除失败');
			}else if(data == 'statice_success'){
				alert('静态化文件成功');
				$("#"+id).find('a.sta').html('重新静态化');
			}else if(data == 'statice_fail'){
				alert('静态化文件失败');
			}else if(data == 'pro_no_statice_name'){
				alert('请先为产品添加静态化名称');
			}else if(data == 'art_no_statice_name'){
				alert('请先为文章添加静态化名称');
			}else if(data == 'howto_no_statice_name'){
				alert('请先为大类添加howto页静态化名称');
			}else if(data == 'plate_no_statice_name'){
				alert('请先为栏目添加静态化名称');
			}
			$('#dele-tips').remove();
		});
	});
	
});
function deleTip(url,id,dele){
	var h3tips = '删除提示';
	var deletips = '确定删除?';
	if(dele == false){
		h3tips = '静态化提示';
		deletips = '确定静态化?';
	}
	$('#dele-tips').remove();
	$html = '<div id="dele-tips"><h3>'+h3tips+'</h3><p class="make-sure-dele">'+deletips+'</p><p><span><a id="dele-yes" url="'+url+'" trid="'+id+'">是</a></span><span id="dele-no"><a>否</a></span></p></div>';
	$($html).appendTo('body');
}

function changeStatus(_this,url,id){
	$.post(url,{'id':id},function(data){
		if(data==2){
			alert('切换失败');
			return;
		}
		if(data==1 || data==0){
			$(_this).find('img').attr('src',"/Public/admin/images/status-"+data+".gif");
		}else{
			alert('你没有权限');
		}
//		$('#dele-tips').remove();
	});
}
$(function($){
	
	$.Show_Tooltip = function(msg,isErr)
	{
		var time=arguments[2]?arguments[2]:1500;
		var readyFun = function(weebox){
			var fun = function()
			{
				$.weeboxs.close();
			}
			$("#TOOLTIP_BOX").width(weebox.dc.get(0).scrollWidth + 100);
			setTimeout(fun,time);
		};
		var c = 'lb_s';
		if(isErr)
			var c = 'lb_f';
		var html = '<div class="lb_tooltip"><a class="lb_close" href="javascript:;" onclick="$.weeboxs.close()"></a><div class="'+c+'">'+msg+'</div></div>';
		$.weeboxs.close();
		$.weeboxs.open(html, {boxid:'TOOLTIP_BOX',contentType:'text',draggable:false,showButton:false,showHeader:false,width:100,onready:readyFun});
	}
	$.changeSort = function(_this,id,url,type){
		var v = $(_this).val();
		if(!v || isNaN(v)){
			return false;
		}
		$.post(url,{'val':v,'id':id,'type':type},function(data){
			if(data == 1){
				$.Show_Tooltip('修改成功');
			}else{
				$.Show_Tooltip('修改失败');
			}
		});
	}
	$.changeAsort = function(_this,id,url){
		var v = $(_this).val();
		if(isNaN(v)){
			return false;
		}
		$.post(url,{'val':v,'id':id},function(data){
			if(data == 1){
				$.Show_Tooltip('修改成功');
			}else{
				$.Show_Tooltip('修改失败');
			}
		});
	}
})


-->